package com.xidian.zhiancloud.ticketTemplate.ticketContentRisk;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;

public class RaysHarmJson extends TemplateJson {
    public static JsonNode RaysHarm(){
        ObjectMapper mapper = new ObjectMapper();
        // 添加键值对。key是条目的名称，value也是HashMap类型的键值对
        HashMap<String, Object> t1 = new LinkedHashMap<>();

        List<HashMap<String, Object>> t2 = new LinkedList<>();
        HashMap<String,Object> m1 = new LinkedHashMap<>();
        m1.put("认真计算核实安全距离，依据实际情况设置警戒区",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m2 = new LinkedHashMap<>();
        m2.put("操作人员必须按规定穿戴个人防护用品，并佩戴个人剂量计",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m3 = new LinkedHashMap<>();
        m3.put("依据规范划定警戒区，设警戒线并挂危险标志，夜间设置灯光信号，指定专人监护、巡视，防止无关人员进入作业区域，确保警戒线措施有效",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m4 = new LinkedHashMap<>();
        m4.put("作业前30分钟和完毕后通报调度室",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m5 = new LinkedHashMap<>();
        m5.put("严格遵守作业票规定作业时间，严禁提前和延长",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m6 = new LinkedHashMap<>();
        m6.put("严格按照作业票内安全措施限定在控制区内，严禁超作业票许可区域作业",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m7 = new LinkedHashMap<>();
        m7.put("夜间作业配合合格的照明设备",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m8 = new LinkedHashMap<>();
        m8.put("明确相关联系人电话号码，探伤过程必须保证探伤作业人员通讯设施畅通",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m9 = new LinkedHashMap<>();
        m9.put("发现异常情况及时通报调度室，服从调度室等相关人员指挥",getFiled("确认人","String",0,new String[]{}));
        HashMap<String,Object> m10 = new LinkedHashMap<>();
        m10.put("其它安全措施：",getFiled("确认人","String",0,new String[]{}));

        t2.add(m1);
        t2.add(m2);
        t2.add(m3);
        t2.add(m4);
        t2.add(m5);
        t2.add(m6);
        t2.add(m7);
        t2.add(m8);
        t2.add(m9);
        t2.add(m10);

        t1.put("safe_measure",getFiled("安全措施","string",0, t2));
        JsonNode jsonNode = mapper.valueToTree(t1);
        System.out.println(jsonNode);
        return jsonNode;
    }
}
